import request from '@/router/axios';

//账户列表
export const getList = (page, size, params) => {
    return request({
        url: '/api/mgr/userMgr',
        method: 'post',
        params: {
            ...params,
            page,
            size,
        }
    })
}

//收益明细列表
export const getProfitList = (page, size, params) => {
    return request({
        url: '/account/tradeRecord/listProfitForAdmin',
        method: 'post',
        params: {
            ...params,
            page,
            size,
        }
    })
}

//修改账户状态
export const changeStatus = (userId, status) => {
    return request({
        url: '/api/mgr/changeStatus',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            userId,
            status
        }
    })
}

//获取账户上级列表
export const getLeaderList = (page, size, params) => {
    return request({
        url: '/api/mgr/getLeaderList',
        method: 'post',
        params: {
            ...params,
            page,
            size,
        }
    })
}

//设置用户上级
export const setUserLeader = (userId, leaderUserId) => {
    return request({
        url: '/api/mgr/setUserLeader',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            userId,
            leaderUserId
        }
    })
}

//买家列表
export const getBuyerList = (page, size, params) => {
    return request({
        url: '/api/mgr/buyerMgr',
        method: 'post',
        params: {
            ...params,
            page,
            size,
        }
    })
}

//紫微星列表
export const getIntegralList = (page, size, params) => {
    return request({
        url: '/account/integralTradeRecord/listForAdmin',
        method: 'post',
        params: {
            ...params,
            page,
            size,
        }
    })
}
